#include <iostream>
#include <cstring>
#include <cstdlib>

extern "C" {
    #include <oauth.h>
}

class OAuth {
    std::string request_token_uri;
    std::string request_token_url;
    std::string c_key;
    std::string c_secret;
    std::string t_key;
    std::string t_secret;
    std::string req_url;
public:
    OAuth () {};
    ~OAuth() {};

    typedef enum {
        OAUTH_POST,
        OAUTH_GET
    } request_method_t;

    std::string requestToken (const std::string &key,
                              const std::string &secret, 
                              const std::string &request_token_url,
                              request_method_t method,
                              const std::string &post_args = NULL) {
        std::string reply;
/*
        switch (method) {
            case OAUTH_POST:
                req_url = oauth_sign_url2 (request_token_url.c_str(), 
                                          (char**) post_args.c_str(), OA_HMAC, NULL, c_key.c_str(), 
                                          c_secret.c_str(), NULL, NULL);

                reply = oauth_http_get (req_url.c_str(),post_args.c_str());
                break;
            case OAUTH_GET:
                req_url = oauth_sign_url2 (request_token_url.c_str(), 
                                          (char**) post_args.c_str(), OA_HMAC, NULL, c_key.c_str(), 
                                          c_secret.c_str(), NULL, NULL);

                reply = oauth_http_post (req_url.c_str(),post_args.c_str());
                break;
        }
*/
        return reply;
    }
};

int main (int argc, char *argv[]) {
    OAuth oauth;
    
    std::string r;
    r = oauth.requestToken ("key","secret","http://twitter.com/statuses/user_timeline.xml",OAuth::OAUTH_GET,NULL);

    std::cout << r << std::endl;
    return 0;
}
